package cn.brilliantfuture.commentry.entity;

// Generated 2011-11-3 13:34:34 by Hibernate Tools 3.3.0.GA

import static javax.persistence.GenerationType.IDENTITY;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;

/**
 * ExpressInfo generated by hbm2java
 */
@Entity
@Table(name = "express_info", catalog = "cabinet")
public class ExpressInfo implements java.io.Serializable {

	private static final long serialVersionUID = 1L;
	private Integer expressInfoId;
	private String name;
	private String contacter;
	private String phone;
	private String address;
	private Date insertTime;
	private Integer insertUser;
	private boolean deleted;
	private UserGroup group;
	private Set<ExpressPerson> expressPersons = new HashSet<ExpressPerson>(0);
	private Set<OrderInformation> orderInformations = new HashSet<OrderInformation>(0);

	public ExpressInfo() {
	}

	public ExpressInfo(String name) {
		this.name = name;
	}

	public ExpressInfo(String name, String contacter, String phone,
			String address, Date insertTime, Integer insertUser, boolean deleted,
			Set<OrderInformation> orderInformations) {
		this.name = name;
		this.contacter = contacter;
		this.phone = phone;
		this.address = address;
		this.insertTime = insertTime;
		this.insertUser = insertUser;
		this.deleted = deleted;
		this.orderInformations = orderInformations;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "express_info_id", unique = true, nullable = false)
	public Integer getExpressInfoId() {
		return this.expressInfoId;
	}

	public void setExpressInfoId(Integer expressInfoId) {
		this.expressInfoId = expressInfoId;
	}

	@Column(name = "name", nullable = false, length = 100)
	@NotNull
	@Length(max = 100)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "contacter", length = 50)
	@Length(max = 50)
	public String getContacter() {
		return this.contacter;
	}

	public void setContacter(String contacter) {
		this.contacter = contacter;
	}

	@Column(name = "phone", length = 45)
	@Length(max = 45)
	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	@Column(name = "address", length = 100)
	@Length(max = 100)
	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "insert_time", length = 19)
	public Date getInsertTime() {
		return this.insertTime;
	}

	public void setInsertTime(Date insertTime) {
		this.insertTime = insertTime;
	}

	@Column(name = "insert_user")
	public Integer getInsertUser() {
		return this.insertUser;
	}

	public void setInsertUser(Integer insertUser) {
		this.insertUser = insertUser;
	}

	@Column(name = "deleted")
	public boolean isDeleted() {
		return this.deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "expressInfo")
	public Set<OrderInformation> getOrderInformations() {
		return this.orderInformations;
	}

	public void setOrderInformations(Set<OrderInformation> orderInformations) {
		this.orderInformations = orderInformations;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "expressInfo")
	public Set<ExpressPerson> getExpressPersons() {
		return expressPersons;
	}

	public void setExpressPersons(Set<ExpressPerson> expressPersons) {
		this.expressPersons = expressPersons;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "group_id")
	public UserGroup getGroup() {
		return group;
	}

	public void setGroup(UserGroup group) {
		this.group = group;
	}

}
